function bvm = BernsteinElement_2(vv,m,argument_norm)

% argument_norm must be a COLUMN vector

% ouput is of size (ncombos,nobs,nargs)
    
    ncombos = size(vv,1);
    argument_norm2  = permute(repmat(argument_norm,[1 1 ncombos]),[3 2 1]);                % argument_norm is of size (ncombos,nobs,nargs)

    vv2 = permute(repmat(vv,[1 1 size(argument_norm2,2)]),[1 3 2]);      % (ncombos,nobs,nargs)
    
    mm = zeros(size(vv2));
    temp = size(vv2);
    for i=1:size(mm,3)
        mm(:,:,i)  = m(i)*ones(temp(1:2));                                            % (ncombos,nobs,nargs)
    end

    NZ = (vv2 <= mm & vv2 >= 0); % Bernstein pol. is zero otherwise.    % (ncombos,nobs,nargs)

    bvm = zeros(size(argument_norm2)); % Allocate space for pol.

    vv3 = vv2(NZ); mm2 = mm(NZ); argument_norm3 = argument_norm2(NZ);
    Bin = factorial(mm2)./factorial(mm2-vv3)./factorial(vv3);
    bvm(NZ) = Bin.*(argument_norm3.^vv3).*((1-argument_norm3).^(mm2-vv3));
    
end